.class public Lcom/netease/newsreader/view/NewsImageViewer;
.super Lcom/netease/newsreader/view/ImageViewer;
.source "NewsImageViewer.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/netease/newsreader/view/NewsImageViewer$LoadingImage;
    }
.end annotation


# instance fields
.field private mLoadingImages:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Lcom/netease/newsreader/view/NewsImageViewer$LoadingImage;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1
    .parameter "context"

    .prologue
    .line 32
    invoke-direct {p0, p1}, Lcom/netease/newsreader/view/ImageViewer;-><init>(Landroid/content/Context;)V

    .line 25
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/netease/newsreader/view/NewsImageViewer;->mLoadingImages:Ljava/util/HashMap;

    .line 33
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .parameter "context"
    .parameter "attrs"

    .prologue
    .line 28
    invoke-direct {p0, p1, p2}, Lcom/netease/newsreader/view/ImageViewer;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 25
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/netease/newsreader/view/NewsImageViewer;->mLoadingImages:Ljava/util/HashMap;

    .line 29
    return-void
.end method

.method static synthetic access$0(Lcom/netease/newsreader/view/NewsImageViewer;Lcom/netease/newsreader/view/NewsImageViewer$LoadingImage;Ljava/lang/Object;Landroid/graphics/Bitmap;)V
    .locals 0
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    .line 97
    invoke-direct {p0, p1, p2, p3}, Lcom/netease/newsreader/view/NewsImageViewer;->callback(Lcom/netease/newsreader/view/NewsImageViewer$LoadingImage;Ljava/lang/Object;Landroid/graphics/Bitmap;)V

    return-void
.end method

.method private callback(Lcom/netease/newsreader/view/NewsImageViewer$LoadingImage;Ljava/lang/Object;Landroid/graphics/Bitmap;)V
    .locals 4
    .parameter "loadingImage"
    .parameter "tag"
    .parameter "bitmap"

    .prologue
    .line 98
    move-object v2, p2

    check-cast v2, Landroid/view/View;

    .line 99
    .local v2, view:Landroid/view/View;
    if-nez v2, :cond_0

    .line 110
    :goto_0
    return-void

    .line 102
    :cond_0
    invoke-virtual {v2}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v3

    if-eqz v3, :cond_1

    invoke-virtual {v2}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v3

    invoke-virtual {v3, p1}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_1

    .line 103
    const v3, 0x7f0c00af

    invoke-virtual {v2, v3}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/netease/newsreader/view/ImageViewTouch;

    .line 104
    .local v0, imageViewTouch:Lcom/netease/newsreader/view/ImageViewTouch;
    const/4 v3, 0x1

    invoke-virtual {v0, p3, v3}, Lcom/netease/newsreader/view/ImageViewTouch;->setImageBitmapResetBase(Landroid/graphics/Bitmap;Z)V

    .line 105
    const v3, 0x7f0c00ce

    invoke-virtual {v2, v3}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    .line 106
    .local v1, loadingBar:Landroid/view/View;
    const/16 v3, 0x8

    invoke-virtual {v1, v3}, Landroid/view/View;->setVisibility(I)V

    .line 109
    .end local v0           #imageViewTouch:Lcom/netease/newsreader/view/ImageViewTouch;
    .end local v1           #loadingBar:Landroid/view/View;
    :cond_1
    const/4 v3, 0x0

    invoke-virtual {p1, v3}, Lcom/netease/newsreader/view/NewsImageViewer$LoadingImage;->setTag(Ljava/lang/Object;)V

    goto :goto_0
.end method


# virtual methods
.method protected getBitmap(ILjava/lang/Object;Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;
    .locals 6
    .parameter "position"
    .parameter "key"
    .parameter "cached"

    .prologue
    .line 61
    move-object v0, p2

    check-cast v0, Lcom/netease/newsreader/bean/PhotoInfo;

    .line 62
    .local v0, info:Lcom/netease/newsreader/bean/PhotoInfo;
    if-nez v0, :cond_1

    .line 63
    if-eqz p3, :cond_0

    .line 64
    invoke-virtual {p3}, Landroid/graphics/Bitmap;->recycle()V

    .line 66
    :cond_0
    const/4 v4, 0x0

    .line 94
    :goto_0
    return-object v4

    .line 69
    :cond_1
    iget-object v4, p0, Lcom/netease/newsreader/view/NewsImageViewer;->mLoadingImages:Ljava/util/HashMap;

    invoke-virtual {v0}, Lcom/netease/newsreader/bean/PhotoInfo;->getImgurl()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/netease/newsreader/view/NewsImageViewer$LoadingImage;

    .line 70
    .local v2, loadingImage:Lcom/netease/newsreader/view/NewsImageViewer$LoadingImage;
    if-nez v2, :cond_2

    .line 71
    new-instance v2, Lcom/netease/newsreader/view/NewsImageViewer$LoadingImage;

    .end local v2           #loadingImage:Lcom/netease/newsreader/view/NewsImageViewer$LoadingImage;
    invoke-direct {v2, p0, v0}, Lcom/netease/newsreader/view/NewsImageViewer$LoadingImage;-><init>(Lcom/netease/newsreader/view/NewsImageViewer;Lcom/netease/newsreader/bean/PhotoInfo;)V

    .line 72
    .restart local v2       #loadingImage:Lcom/netease/newsreader/view/NewsImageViewer$LoadingImage;
    iget-object v4, p0, Lcom/netease/newsreader/view/NewsImageViewer;->mLoadingImages:Ljava/util/HashMap;

    invoke-virtual {v0}, Lcom/netease/newsreader/bean/PhotoInfo;->getImgurl()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 73
    if-eqz p3, :cond_2

    .line 74
    invoke-virtual {p3}, Landroid/graphics/Bitmap;->recycle()V

    .line 75
    const/4 p3, 0x0

    .line 79
    :cond_2
    if-eqz p3, :cond_3

    invoke-virtual {p3}, Landroid/graphics/Bitmap;->isRecycled()Z

    move-result v4

    if-eqz v4, :cond_4

    .line 80
    :cond_3
    invoke-virtual {v2}, Lcom/netease/newsreader/view/NewsImageViewer$LoadingImage;->getBitmap()Landroid/graphics/Bitmap;

    move-result-object p3

    .line 83
    :cond_4
    invoke-virtual {p0}, Lcom/netease/newsreader/view/NewsImageViewer;->getCurrent()I

    move-result v4

    if-ne p1, v4, :cond_5

    invoke-virtual {p0}, Lcom/netease/newsreader/view/NewsImageViewer;->getCurrentView()Landroid/view/View;

    move-result-object v3

    .line 84
    .local v3, view:Landroid/view/View;
    :goto_1
    invoke-virtual {v2, v3}, Lcom/netease/newsreader/view/NewsImageViewer$LoadingImage;->setTag(Ljava/lang/Object;)V

    .line 85
    invoke-virtual {v3, v2}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    .line 87
    const v4, 0x7f0c00ce

    invoke-virtual {v3, v4}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    .line 89
    .local v1, loadingBar:Landroid/view/View;
    if-nez p3, :cond_6

    .line 90
    const/4 v4, 0x0

    invoke-virtual {v1, v4}, Landroid/view/View;->setVisibility(I)V

    :goto_2
    move-object v4, p3

    .line 94
    goto :goto_0

    .line 83
    .end local v1           #loadingBar:Landroid/view/View;
    .end local v3           #view:Landroid/view/View;
    :cond_5
    invoke-virtual {p0}, Lcom/netease/newsreader/view/NewsImageViewer;->getNextView()Landroid/view/View;

    move-result-object v3

    goto :goto_1

    .line 92
    .restart local v1       #loadingBar:Landroid/view/View;
    .restart local v3       #view:Landroid/view/View;
    :cond_6
    const/16 v4, 0x8

    invoke-virtual {v1, v4}, Landroid/view/View;->setVisibility(I)V

    goto :goto_2
.end method

.method protected isCacheChanged(Ljava/lang/Object;Landroid/graphics/Bitmap;)Z
    .locals 1
    .parameter "key"
    .parameter "cached"

    .prologue
    .line 56
    const/4 v0, 0x1

    return v0
.end method

.method public setList(Ljava/util/List;I)V
    .locals 2
    .parameter "list"
    .parameter "position"

    .prologue
    const/4 v1, 0x0

    .line 37
    iget-object v0, p0, Lcom/netease/newsreader/view/NewsImageViewer;->mLoadingImages:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->clear()V

    .line 38
    invoke-virtual {p0}, Lcom/netease/newsreader/view/NewsImageViewer;->getCurrentView()Landroid/view/View;

    move-result-object v0

    invoke-virtual {v0, v1}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    .line 39
    invoke-virtual {p0}, Lcom/netease/newsreader/view/NewsImageViewer;->getNextView()Landroid/view/View;

    move-result-object v0

    invoke-virtual {v0, v1}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    .line 40
    invoke-super {p0, p1, p2}, Lcom/netease/newsreader/view/ImageViewer;->setList(Ljava/util/List;I)V

    .line 42
    return-void
.end method

.method protected setViewBitmap(Lcom/netease/newsreader/view/ImageViewTouch;Landroid/graphics/Bitmap;)V
    .locals 1
    .parameter "view"
    .parameter "bitmap"

    .prologue
    .line 46
    if-nez p1, :cond_0

    .line 50
    :goto_0
    return-void

    .line 49
    :cond_0
    const/4 v0, 0x1

    invoke-virtual {p1, p2, v0}, Lcom/netease/newsreader/view/ImageViewTouch;->setImageBitmapResetBase(Landroid/graphics/Bitmap;Z)V

    goto :goto_0
.end method
